#ifndef OXFORDLASERSENSORDLL_H
#define OXFORDLASERSENSORDLL_H

#include "oxfordlasersensordll_global.h"

typedef struct LaserSensorData{
    bool    SensorConnectMark;
    double  Data[8];
    double  X;
    double  Y;
    double  Z;
    double  A;
    double  B;
    double  C;
    double  Gap;
    double  Mismatch;
    double  ErrorMessage;
}ST_LaserSensorData;

class OxfordLaserSensor : public OxfordLaserSensorDLL{
private:
    int        toLaserSensorSocket;
    QByteArray RecvRawLaserSensorData;
    ST_LaserSensorData mLaserSensorData;
public:
    OxfordLaserSensor();
    ~OxfordLaserSensor();
public:
    short LaserSensorConnect(const QString ip);
    short LaserSensorLoopRun();
    short LaserSensorLoopRunSend();
    short LaserSensorLoopRunReceive();

    short GetXDataOnLaserCoordinate(double &data);
    short GetYDataOnLaserCoordinate(double &data);
    short GetZDataOnLaserCoordinate(double &data);
    short GetADataOnLaserCoordinate(double &data);
    short GetBDataOnLaserCoordinate(double &data);
    short GetCDataOnLaserCoordinate(double &data);
    short GetGapData(double &data);
    short GetMismatchData(double &data);

    short isError();
private:
    short LaserSensorDataDeal();
};

#endif // OXFORDLASERSENSORDLL_H
